import 'package:base_flutter/base_flutter.dart';
import 'package:ls_work/a_elder/models/elder_entity.dart';
import 'package:ls_work/model/customer_info_model.dart';

class ElderDetailInfoViewModel extends BaseViewModel{
  dynamic customerId;

  var customerModel = CustomerInfoModel();

  ElderInfo? elderInfo;

  ElderDetailInfoViewModel(super.context,{required this.customerId});


  Future<void> getCustomerDetail() async {
    showLoadingState();
    try{
      elderInfo = await customerModel.getElderInfo(customerId);
      showContent();
    }catch(e){
      showErrorState(e.toNetError());
    }
  }

  @override
  void onCreated() {
    super.onCreated();
    getCustomerDetail();
  }


}